package com.ch.home.bean;

/**
 * 资源地址类
 * Created by CHEN on 2019/8/24.
 * OK
 */
public class Source {

    private Integer sourceId;
    private Integer foreignId;
    private String url;
    private String sourcePreviewUrl;
    private Integer typeId;

    public Source() {
    }

    public Source(Integer sourceId, Integer foreignId, String url, String sourcePreviewUrl, Integer typeId) {

        this.sourceId = sourceId;
        this.foreignId = foreignId;
        this.url = url;
        this.sourcePreviewUrl = sourcePreviewUrl;
        this.typeId = typeId;
    }

    public Integer getSourceId() {

        return sourceId;
    }

    public void setSourceId(Integer sourceId) {
        this.sourceId = sourceId;
    }

    public Integer getForeignId() {
        return foreignId;
    }

    public void setForeignId(Integer foreignId) {
        this.foreignId = foreignId;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSourcePreviewUrl() {
        return sourcePreviewUrl;
    }

    public void setSourcePreviewUrl(String sourcePreviewUrl) {
        this.sourcePreviewUrl = sourcePreviewUrl;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    @Override
    public boolean equals(Object o) {

        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        Source source = (Source) o;

        if (sourceId != null ? !sourceId.equals(source.sourceId) : source.sourceId != null) return false;
        if (foreignId != null ? !foreignId.equals(source.foreignId) : source.foreignId != null) return false;
        if (url != null ? !url.equals(source.url) : source.url != null) return false;
        if (sourcePreviewUrl != null ? !sourcePreviewUrl.equals(source.sourcePreviewUrl) : source.sourcePreviewUrl != null)
            return false;
        return typeId != null ? typeId.equals(source.typeId) : source.typeId == null;
    }

    @Override
    public int hashCode() {
        int result = sourceId != null ? sourceId.hashCode( ) : 0;
        result = 31 * result + (foreignId != null ? foreignId.hashCode( ) : 0);
        result = 31 * result + (url != null ? url.hashCode( ) : 0);
        result = 31 * result + (sourcePreviewUrl != null ? sourcePreviewUrl.hashCode( ) : 0);
        result = 31 * result + (typeId != null ? typeId.hashCode( ) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Source{" +
                "sourceId=" + sourceId +
                ", foreignId=" + foreignId +
                ", url='" + url + '\'' +
                ", sourcePreviewUrl='" + sourcePreviewUrl + '\'' +
                ", typeId=" + typeId +
                '}';
    }
}
